package homework;

public class practice4 {
    public static void main(String[] args) {
        double[] arr = {0.104, -0.03, -0.062,0.012,-0.061,-0.19, -0.038, 0.009, -0.045, 0.055};
        int zhuang = 0;
        int pei = 0;

        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > 0) {
                zhuang += 1;
            } else if (arr[i] < 0) {
                pei += 1;
            }
        }
        System.out.println("赚钱的股票一共有："+zhuang+"只");
        System.out.println("赔钱的股票一共有："+pei+"只");
    }
}
